#####################################################################
# File:         __init__.py
# Library:      KnowledgeEngine
#
# Copyright:    Copyright (c) 2001, Faulker Ltd.
# Author:       Brian Oliver
#
# Description:  This file initialise the Faulker Knowledge Engine
#               package
#####################################################################

#####################################################################
## Knowledge Engine Library Imports

#Start Knowledge Engine bootstrap process
from KnowledgeEngineCore import onBeforeStart, onAfterStart
KnowledgeEngineCore.onBeforeStart()

#Import Knowledge Engine Editlets
from Editlets import *

#Import Knowledge Engine packages
from Environment.Environment import *
from Model.Model import *
from Event import *
from Library.Library import *
from Actions import *
from Components import *
from Elements import *
from Reports import *

#Finalize Knowledge Engine bootstrap process
KnowledgeEngineCore.onAfterStart()

#####################################################################
## Zope Library Imports
from ImageFile import ImageFile

#####################################################################
## Python Library Imports
# (none)

#####################################################################

def initialize(registrar):
    registrar.registerClass(Environment, constructors=(manage_addEnvironmentForm, manage_addEnvironment), icon = 'Environment/www/icon.gif')

## Initialize the icons for the registered GenericObject classes
## (automatically updated when components are installed/imported)
misc_ = {}

#go through all of the registered class info
for classInfo in KnowledgeEngineCore.getRegisteredClassInfo():

    #does the classInfo have an icon
    if classInfo.getClassIcon() != None:
    
        #add the icon to the misc_ dictionary
        misc_.update({"%s.gif" % (classInfo.getClassName(),): classInfo.getClassIcon()})       

#core knowledge engine icons
misc_.update({
    'up.icon.gif' : ImageFile('www/up.icon.gif',globals()),
    'down.icon.gif' : ImageFile('www/down.icon.gif',globals()),
    'blank.icon.gif' : ImageFile('www/blank.icon.gif',globals()),
    'epoz.enabled.icon.gif' : ImageFile('www/epoz.enabled.icon.gif',globals()),
    'epoz.disabled.icon.gif' : ImageFile('www/epoz.disabled.icon.gif',globals()),
    'delete.icon.gif' : ImageFile('www/delete.icon.gif',globals()),
    'text.enabled.icon.gif' : ImageFile('www/text.enabled.icon.gif',globals()),
})

#scored360report images
misc_.update({
    'red.gif' : ImageFile('Reports/Scored360Report/www/red.gif',globals()),
    'green.gif' : ImageFile('Reports/Scored360Report/www/green.gif',globals()),
    'spacer.gif' : ImageFile('Reports/Scored360Report/www/spacer.gif',globals()),
})

#####################################################################